import 'package:safetymonitor/generated/json/base/json_convert_content.dart';
import 'package:safetymonitor/app/data/entities/home/monitor/safe_real_time_monitor_entity.dart';

SafeRealTimeMonitorEntity $SafeRealTimeMonitorEntityFromJson(Map<String, dynamic> json) {
  final SafeRealTimeMonitorEntity safeRealTimeMonitorEntity = SafeRealTimeMonitorEntity();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    safeRealTimeMonitorEntity.id = id;
  }
  final int? companyId = jsonConvert.convert<int>(json['companyId']);
  if (companyId != null) {
    safeRealTimeMonitorEntity.companyId = companyId;
  }
  final String? companyName = jsonConvert.convert<String>(json['companyName']);
  if (companyName != null) {
    safeRealTimeMonitorEntity.companyName = companyName;
  }
  final dynamic pointId = json['pointId'];
  if (pointId != null) {
    safeRealTimeMonitorEntity.pointId = pointId;
  }
  final String? point = jsonConvert.convert<String>(json['point']);
  if (point != null) {
    safeRealTimeMonitorEntity.point = point;
  }
  final dynamic alarmType = json['alarmType'];
  if (alarmType != null) {
    safeRealTimeMonitorEntity.alarmType = alarmType;
  }
  final int? alarmLevel = jsonConvert.convert<int>(json['alarmLevel']);
  if (alarmLevel != null) {
    safeRealTimeMonitorEntity.alarmLevel = alarmLevel;
  }
  final int? val = jsonConvert.convert<int>(json['val']);
  if (val != null) {
    safeRealTimeMonitorEntity.val = val;
  }
  final int? alarmStartTime = jsonConvert.convert<int>(json['alarmStartTime']);
  if (alarmStartTime != null) {
    safeRealTimeMonitorEntity.alarmStartTime = alarmStartTime;
  }
  final int? alarmEndTime = jsonConvert.convert<int>(json['alarmEndTime']);
  if (alarmEndTime != null) {
    safeRealTimeMonitorEntity.alarmEndTime = alarmEndTime;
  }
  final int? status = jsonConvert.convert<int>(json['status']);
  if (status != null) {
    safeRealTimeMonitorEntity.status = status;
  }
  final dynamic disposalMethod = json['disposalMethod'];
  if (disposalMethod != null) {
    safeRealTimeMonitorEntity.disposalMethod = disposalMethod;
  }
  final dynamic disposalMeasures = json['disposalMeasures'];
  if (disposalMeasures != null) {
    safeRealTimeMonitorEntity.disposalMeasures = disposalMeasures;
  }
  final dynamic disarmingDescription = json['disarmingDescription'];
  if (disarmingDescription != null) {
    safeRealTimeMonitorEntity.disarmingDescription = disarmingDescription;
  }
  final dynamic disposalMeasuresAnnex = json['disposalMeasuresAnnex'];
  if (disposalMeasuresAnnex != null) {
    safeRealTimeMonitorEntity.disposalMeasuresAnnex = disposalMeasuresAnnex;
  }
  final String? disarmingDescriptionAnnex = jsonConvert.convert<String>(json['disarmingDescriptionAnnex']);
  if (disarmingDescriptionAnnex != null) {
    safeRealTimeMonitorEntity.disarmingDescriptionAnnex = disarmingDescriptionAnnex;
  }
  final dynamic alramMinimum = json['alramMinimum'];
  if (alramMinimum != null) {
    safeRealTimeMonitorEntity.alramMinimum = alramMinimum;
  }
  final int? createTime = jsonConvert.convert<int>(json['createTime']);
  if (createTime != null) {
    safeRealTimeMonitorEntity.createTime = createTime;
  }
  return safeRealTimeMonitorEntity;
}

Map<String, dynamic> $SafeRealTimeMonitorEntityToJson(SafeRealTimeMonitorEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['companyId'] = entity.companyId;
  data['companyName'] = entity.companyName;
  data['pointId'] = entity.pointId;
  data['point'] = entity.point;
  data['alarmType'] = entity.alarmType;
  data['alarmLevel'] = entity.alarmLevel;
  data['val'] = entity.val;
  data['alarmStartTime'] = entity.alarmStartTime;
  data['alarmEndTime'] = entity.alarmEndTime;
  data['status'] = entity.status;
  data['disposalMethod'] = entity.disposalMethod;
  data['disposalMeasures'] = entity.disposalMeasures;
  data['disarmingDescription'] = entity.disarmingDescription;
  data['disposalMeasuresAnnex'] = entity.disposalMeasuresAnnex;
  data['disarmingDescriptionAnnex'] = entity.disarmingDescriptionAnnex;
  data['alramMinimum'] = entity.alramMinimum;
  data['createTime'] = entity.createTime;
  return data;
}

extension SafeRealTimeMonitorEntityExtension on SafeRealTimeMonitorEntity {
  SafeRealTimeMonitorEntity copyWith({
    int? id,
    int? companyId,
    String? companyName,
    dynamic pointId,
    String? point,
    dynamic alarmType,
    int? alarmLevel,
    int? val,
    int? alarmStartTime,
    int? alarmEndTime,
    int? status,
    dynamic disposalMethod,
    dynamic disposalMeasures,
    dynamic disarmingDescription,
    dynamic disposalMeasuresAnnex,
    String? disarmingDescriptionAnnex,
    dynamic alramMinimum,
    int? createTime,
  }) {
    return SafeRealTimeMonitorEntity()
      ..id = id ?? this.id
      ..companyId = companyId ?? this.companyId
      ..companyName = companyName ?? this.companyName
      ..pointId = pointId ?? this.pointId
      ..point = point ?? this.point
      ..alarmType = alarmType ?? this.alarmType
      ..alarmLevel = alarmLevel ?? this.alarmLevel
      ..val = val ?? this.val
      ..alarmStartTime = alarmStartTime ?? this.alarmStartTime
      ..alarmEndTime = alarmEndTime ?? this.alarmEndTime
      ..status = status ?? this.status
      ..disposalMethod = disposalMethod ?? this.disposalMethod
      ..disposalMeasures = disposalMeasures ?? this.disposalMeasures
      ..disarmingDescription = disarmingDescription ?? this.disarmingDescription
      ..disposalMeasuresAnnex = disposalMeasuresAnnex ?? this.disposalMeasuresAnnex
      ..disarmingDescriptionAnnex = disarmingDescriptionAnnex ?? this.disarmingDescriptionAnnex
      ..alramMinimum = alramMinimum ?? this.alramMinimum
      ..createTime = createTime ?? this.createTime;
  }
}